<template>
  <div>
    <el-button
      plain
      type="primary"
      style="margin-bottom: 10px;"
      @click="$emit('remove')">
      清空错误信息
    </el-button>
    <el-alert
      :closable="false"
      show-icon
      title="导入的数据中存在以下错误，请按照提示修改后重新导入！"
      type="error">
    </el-alert>
    <div
      style="margin-bottom: 50px;"
      v-for="(v, k) in info">
      <component
        :is="k"
        :info="v"
        :key="k"/>
    </div>
  </div>
</template>

<script>
import dataType from "@/views/toolkit/dynamic/error/data-type";
import repeat from "@/views/toolkit/dynamic/error/repeat";
import repeatAll from "@/views/toolkit/dynamic/error/repeat-all";
import permissions from "@/views/toolkit/dynamic/error/permissions";
import required from "@/views/toolkit/dynamic/error/required";
import dictionary from "@/views/toolkit/dynamic/error/dictionary";

export default {
  name: "error",
  components: {
    dataType,
    repeat,
    repeatAll,
    permissions,
    required,
    dictionary
  },
  props: {
    info: {
      type: Object,
      default() {
        return {}
      }
    }
  }
}
</script>

<style scoped>

</style>
